/**
 * @USER: Administrator
 * @DATE: 2024/9/15 下午1:20
 * @VERSION: 1.0.0
 */
public class LC1572 {
    public static void main(String[] args) {

    }

    public int diagonalSum(int[][] mat) {
        int sum = 0;
        for(int i = 0; i < mat.length; i++) {
            for(int j = 0; j < mat[0].length; j++) {
                if (i==j){
                    sum += mat[i][j];
                    continue;
                }

                if (i+j == mat.length-1){
                    sum += mat[i][j];
                }

            }
        }
        return sum;
    }

}
